package com.hnevc.xiewenguang;

import java.util.Scanner;
public class Example01 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("输入一个整数:");
        int number = in.nextInt();
        for (int i = 2; i <= number; i++) {
            if (isPrime(i)) {
                System.out.println(i);
            }
        }
    }

    public static boolean isPrime(int n) {
        for (int j = 2; j < n; j++) {
            if (n % j == 0) {
                return false;
            }
        }
        return true;
    }
}